using System.ServiceModel;

namespace CalculatorFour
{
    public class WCFProxyFactory : IProxyFactory
    {
        #region IProxyFactory Members

        public IClientProxy<TChannel> GetProxy<TChannel>(string endpointName) where TChannel : ICommunicationObject
        {
            var factory = new ChannelFactory<TChannel>(endpointName);
            return new ClientProxy<TChannel>(factory.CreateChannel());
        }

        #endregion
    }
}